<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/png" href="/image/favicon.png">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simple Video Player</title>
    <style>
        /* 设置全局样式 */
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            font-family: Arial, sans-serif;
            color: white;
            overflow: hidden;
        }

        /* 设置背景图片 */
        body {
            background-image: url('/image/1.jpg');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* 导航栏样式 */
        .navbar {
            width: 100%;
            background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
            padding: 10px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        }

        .navbar a {
            color: white;
            text-decoration: none;
            font-size: 1.1em;
            margin: 0 10px;
            transition: opacity 0.3s ease;
        }

        .navbar a:hover {
            opacity: 0.8; /* 鼠标悬停时降低透明度 */
        }

        /* 视频播放器容器 */
        .video-container {
            width: 90%; /* 电脑端宽度增加 */
            max-width: 1000px; /* 最大宽度增加 */
            background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
            padding: 20px;
            border-radius: 15px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
            text-align: center;
            position: relative; /* 用于定位全屏按钮 */
            margin-top: 20px; /* 与导航栏保持距离 */
        }

        /* 视频播放器样式 */
        video {
            width: 100%;
            border-radius: 5px;
        }

        /* 标题样式 */
        h1 {
            margin-top: 0;
            font-size: 2.5em;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        }

        /* 描述文本样式 */
        p {
            font-size: 1.2em;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        }

        /* 全屏按钮样式 */
        .fullscreen-btn {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            padding: 10px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 1em;
        }

        /* 手机端适配 */
        @media (max-width: 768px) {
            .video-container {
                width: 95%; /* 手机端宽度增加 */
                padding: 10px; /* 减少内边距 */
            }

            h1 {
                font-size: 2em; /* 标题字体缩小 */
            }

            p {
                font-size: 1em; /* 描述字体缩小 */
            }

            video {
                height: auto; /* 视频高度自适应 */
            }

            .fullscreen-btn {
                font-size: 0.9em; /* 缩小按钮字体 */
                padding: 8px; /* 缩小按钮内边距 */
            }
        }

        /* 超小屏幕适配（如竖屏手机） */
        @media (max-width: 480px) {
            h1 {
                font-size: 1.5em; /* 进一步缩小标题字体 */
            }

            p {
                font-size: 0.9em; /* 进一步缩小描述字体 */
            }

            .fullscreen-btn {
                font-size: 0.8em; /* 进一步缩小按钮字体 */
                padding: 6px; /* 进一步缩小按钮内边距 */
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <div class="navbar">
        <div>
            <a href="/home.html">回到首页</a>
        </div>
        <div>
            <a href="/log.html">登录</a>
            <a href="/register.html">注册</a>
        </div>
    </div>

    <!-- 视频播放器容器 -->
    <div class="video-container">
        <h1>To Fight Monsters</h1>
        <p>Today, we are canceling the apocalypse!</p>
        <!-- 视频播放器 -->
        <video controls id="video-player" playsinline webkit-playsinline>
            <source src="/vedio/1.mp4" type="video/mp4">
            Your browser does not support the video tag.
        </video>
        <!-- 全屏按钮 -->
        <button class="fullscreen-btn" id="fullscreen-btn">全屏</button>
    </div>

    <script>
        // 获取视频元素和全屏按钮
        const videoPlayer = document.getElementById('video-player');
        const fullscreenBtn = document.getElementById('fullscreen-btn');

        // 全屏按钮点击事件
        fullscreenBtn.addEventListener('click', () => {
            if (document.fullscreenElement) {
                // 如果当前是全屏模式，则退出全屏
                document.exitFullscreen();
            } else {
                // 否则进入全屏模式
                if (videoPlayer.requestFullscreen) {
                    videoPlayer.requestFullscreen();
                } else if (videoPlayer.webkitRequestFullscreen) { // Safari兼容
                    videoPlayer.webkitRequestFullscreen();
                } else if (videoPlayer.msRequestFullscreen) { // IE/Edge兼容
                    videoPlayer.msRequestFullscreen();
                }
            }
        });

        // 监听全屏状态变化
        document.addEventListener('fullscreenchange', () => {
            if (document.fullscreenElement) {
                fullscreenBtn.textContent = '退出全屏';
            } else {
                fullscreenBtn.textContent = '全屏';
            }
        });
    </script>
</body>
</html>